/*
 * firmware_uart.h
 * Firmware for SeeedStudio Mesh Bee(Zigbee) module
 *
 * Copyright (c) NXP B.V. 2012.
 * Spread by SeeedStudio
 * Author     : Jack Shao
 * Create Time: 2013/10
 * Change Log :
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef __UART_H__
#define __UART_H__

#include <jendefs.h>

#define TXFIFOLEN               32
#define RXFIFOLEN               32
#define UART_TX_RB_LEN          100
#define UART_RX_RB_LEN          64

#define THRESHOLD_READ          50



void ringbuf_vInitialize();
void uart_register_callback();
void uart_initialize(void);
bool uart_pass_up(char *buff, unsigned short len);
bool uart_get_tx_status_busy();
void uart_trigger_tx();
void uart_tx_data(void *data, int len);
int uart_printf(const char *fmt, ...);
int AT_setBaudRateUart1(uint16 *regAddr);
int AT_printBaudRate(uint16 *regAddr);

#endif /* __UART_H__ */
